package cn.zktr.Personnel.model.service.tantiantian;

import javax.transaction.Transactional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.alibaba.fastjson.JSONArray;

import cn.zktr.Personnel.model.dao.tantiantian.JnxxDao;
import cn.zktr.Personnel.model.mappers.tantiantian.JiNengMapper;
import cn.zktr.Personnel.model.pojos.PerPmsZCls;
import cn.zktr.Personnel.model.pojos.PerPmsZJnxx;

@Service
@Transactional(rollbackOn=Exception.class)
public class JiNengService {
 @Autowired
 private JiNengMapper jineng;
 
	@Autowired 
	private JnxxDao jnxxdao;

 //查询所有技能
 public JSONArray select_jineng() {
	 return jineng.select_Jnxx();
 }
 //查询所有证书
 public JSONArray select_cls() {
	 return jineng.select_cls();
 }
 //新增技能
 public void jineng_add(PerPmsZJnxx jnxx, Integer clsid) {
	 PerPmsZCls cls = jineng.select_clsbYID(clsid);
	 jnxx.setPerPmsZCl(cls);
	 jnxxdao.save(jnxx);
		
 }
}
